/* eslint valid-jsdoc: "off" */

/**
 * @param {Egg.EggAppInfo} appInfo app info
 */
module.exports = appInfo => {
  /**
   * built-in config
   * @type {Egg.EggAppConfig}
   **/
  const config = exports = {};

  // use for cookie sign key, should change to your own and keep security
  config.keys = appInfo.name + '_1722498920151_8844';

  // add your middleware config here
  config.middleware = ['errorHandler']

  config.security = {
    csrf: {
      enable: false
    }
  }
  //确定静态资源访问地址
  config.static = {
    prefix: '/public/',
  };
  // recommended
  config.mongoose = {
    client: {
      url: 'mongodb://127.0.0.1/egg-video',
      options: {},
      plugins: [],
    },
  };
  //redis
  config.redis = {
    client: {
      port: 6379, // Redis 端口号
      host: '127.0.0.1', // Redis 主机名
      password: '',
      db: 1, // Redis 数据库索引
    },
  };
  config.multipart = {
    mode: 'file',
    fileSize: '10mb',  // 最大上传文件大小
    whitelist: ['.png', '.jpg', '.jpeg'],  // 允许上传的文件类型
  };

  // add your user config here
  const userConfig = {
    // myAppName: 'egg',
  };



  return {
    ...config,
    ...userConfig,
  };
};
